﻿-- Simple Dungeon Keeper AI

-- Tell the engine that this file contains an AI (and under what name)

ai_register('dk.simple')


function onCreatureSpawned(creature)
	
end

function onAttacked(target, attacker, attackSpell, attackDmg, attackDmgType)
	--if (target:getTeam() ~= attacker:getTeam()) then
	--	chat:SayPM(target, attacker, "Hey! Stop attacking me!")
	--	return true
	--end
	
	-- Order the target to attack the attacker with the default attack
	if (target:canMelee(attacker)) then
		target:Melee(attacker)
		return true;
	end
	
	local spells = target:getSpells()
		
	return false	
end

function onThink ()
	
end



ai_register_action('onAttacked', onAttacked);
ai_register_action('onThink', onThink);
